<form method="post" name="frm_SelRail" onSubmit="return false;" action="{$apm.baseurl}search/{$form_act}">
<div class="mt10 mb10">
	<p>{if $block_text}{$block_text}<br />{/if}
	{if $SelFlag != 1}<span class="color02">※10ヵ所まで選択できます。</span>{/if}</p>
</div>

{if $SelFlag <> 1 && $SelFlag <> 2}

<div id="select_area02">
<ul>
{foreach from=$Mapping item=v name="prefLoop"}
	<li><a href="#area{$smarty.foreach.prefLoop.iteration}">{$v.PrefName}</a></li>
{/foreach}
</ul>
</div>

{foreach from=$Mapping key=prefCd item=pref name="prefLoop"} {* 都道府県ループ *}
	<div class="selectdetailbox" id="area{$smarty.foreach.prefLoop.iteration}">
		<div class="mt20"><p class="name">{$pref.PrefName}</p></div>
	</div>
	<!-- innerBlock01 -->
	<div  class="innerbox01">
	{foreach from=$pref.EnsenKbnList item=ensenKbn} {* 沿線ループ *}
		<!-- innerbox02 -->
		<div  class="innerbox02">
		<div class="area"><p>{$ensenKbn.EnsenKbnName}</p></div>
		{foreach from=$ensenKbn.RailList item=rail name=railLoop} {* 駅ループ *}
			{if $smarty.foreach.railLoop.iteration % 3 == 1}
			{if $smarty.foreach.railLoop.iteration + 3 > $smarty.foreach.railLoop.total}<ul class="hr_none">
			{else}<ul>{/if}{/if}
{if $rail.TENPO_COUNT == 0}
	{assign var="disabled" value=" disabled"}
{else}
	{assign var="disabled" value=""}
{/if}
				<li>
				{if $rail.STATIC_URL == ""}<label>{/if}
				<input type="{if $SelFlag == 1}radio{else}checkbox{/if}" id="{$rail.TODOUFUKEN_CD}" name="RailCd[]" value="{$rail.T57_ENSEN_SHIKUCHOUSON_CD}" {if $rail.DATACNT == 0}disabled {/if}{$rail.checked}/>
				{if $rail.STATIC_URL != "" && $rail.DATACNT > 0}<a href="{$rail.STATIC_URL}">{/if}{$rail.ENSEN_NAME}{if $rail.DATACNT>=0}({$rail.DATACNT}件){/if}{if $rail.STATIC_URL != "" && $rail.DATACNT > 0}</a>{/if}
				{if $rail.STATIC_URL == ""}</label>{/if}
				</li>
			{if $smarty.foreach.railLoop.iteration % 3 == 0 || $smarty.foreach.railLoop.last}</ul>{/if}
		{/foreach}
		</div><!-- /innerbox02 -->
	{/foreach}
	</div><!-- /innerBlock01 -->
	{if $SelEkiNull <> 1}
	<div class="btn04">
		<p class="btn"><a href="javascript:SelEnsen()">駅を選択</a></p>
	</div>
	{/if}
{/foreach}

{else}

<div id="select_area02">
{foreach from=$Mapping item=v name="kbnLoop"}
	<ul>
		<li><a href="#Line{$smarty.foreach.kbnLoop.iteration}">{$v.ENSEN_KUBUN}</a></li>
	</ul>
{/foreach}
</div>

{foreach from=$Mapping item=v name="kbnLoop"}
<div class="selectdetailbox" id="Line{$smarty.foreach.kbnLoop.iteration}">
	<div class="mt20"><p class="name">{$v.ENSEN_KUBUN}</p></div>
</div>

<!-- innerBlock01 -->
<div  class="innerbox01">
	<!-- innerBlock02 -->
	<div  class="innerbox02">
	{foreach from=$v.ENSEN_DATA item=ensen name="ensenLoop"}
		{if $smarty.foreach.ensenLoop.iteration % 3 == 1}
		{if $smarty.foreach.ensenLoop.iteration + 3 > $smarty.foreach.ensenLoop.total}<ul class="hr_none">
		{else}<ul>{/if}{/if}
{assign var="check" value=""}{* 再チェック判定 *}
{foreach from=$research_data.ReRailCd key="key" item="rerailcd" name="loopName"}
{if $rerailcd == $ensen.T57_ENSEN_SHIKUCHOUSON_CD}
{assign var="check" value="checked "}
{/if}
{/foreach}
			<li>
			{if $ensen.STATIC_URL == "" || $ensen.DATACNT == 0}<label>{/if}
				<input name="RailCd[]" type="{if $SelFlag == 1}radio{else}checkbox{/if}" id="selectRail{$ensen.T57_ENSEN_SHIKUCHOUSON_CD}" value="{$ensen.T57_ENSEN_SHIKUCHOUSON_CD}" {if $ensen.DATACNT == 0}disabled {/if}{$check}/>
				{if $ensen.STATIC_URL != "" && $ensen.DATACNT != 0}<a href="{$ensen.STATIC_URL}">{/if}
				{$ensen.T57_ENSEN_SHIKUCHOUSON_NAME}({$ensen.DATACNT}件)
			{if $ensen.STATIC_URL != "" && $ensen.DATACNT != 0}</a>{else}</label>{/if}
			</li>
		{if $smarty.foreach.ensenLoop.iteration % 3 == 0 || $smarty.foreach.ensenLoop.last}
		</ul>
		{/if}
	{/foreach}
	</div>
	<!-- /innerBlock02 -->
</div>
<!-- /innerBlock01 -->
{/foreach}

{/if}

{if $SelFlag == 1}
<div id="btn_area">
	<p class="btn">
		<input name="imageField" type="image" class="rollImg" id="imageField" src="/common_new/img/btn_search_l.gif" alt="検索" onmouseover="this.src='/common_new/img/btn_search_l_ov.gif'" onmouseout="this.src='/common_new/img/btn_search_l.gif'" onClick="SelEnsen_radio_selsrh('{$apm.baseurl}search/{$form_act}', '2', 'true');" />
	</p>
</div>
{else}
<div id="search_render" class="mt20">
	<dl>
		<dt>検索結果表示：</dt>
		<dd>
			<ul>
				<li>
					<label><input name="dispCount" type="radio" id="radio" value="10" checked="checked" />
					10件ずつ</label></li>
				<li>
					<label><input type="radio" name="dispCount" id="radio2" value="20" />
					20件ずつ</label></li>
				<li class="last">
					<label><input type="radio" name="dispCount" id="radio3" value="30" />
					30件ずつ</label></li>
			</ul>
		</dd>
	</dl>
	<p class="btn f_r">
		<input name="imageField" type="image" class="rollImg" id="imageField" src="/common_new/img/btn_search_l.gif" alt="検索" onmouseover="this.src='/common_new/img/btn_search_l_ov.gif'" onmouseout="this.src='/common_new/img/btn_search_l.gif'" onClick="SelEnsenKensaku('{$apm.baseurl}rstobi/rstobi');" />
	</p>
</div>
{/if}

<div id="hiddenval">
{$hiddenTag}
</div>
</form>
